package org.happen.android.thrid.icache;

import org.happen.android.app.Globals;
import org.happen.android.thrid.icache.cache.ImageCache.ImageCacheParams;
import org.happen.android.thrid.icache.cache.ImageWorker;
import org.happen.android.thrid.icache.ui.ImageDetailActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import org.happen.android.R;

public class ICaches
{

	public final static String[] tempImageUrls = new String[] { //
	"http://www.51docs.com/UploadPic/4578985/nYeNDWKUsUqCpRpQFP.jpg", //
			"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQ56oPaVD9twbW26YNU7juag7xg4GbM5tqwQlpCR94wSGO_qqgu9ZsFowU", //
			"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTMXbi6L0BYtz7e20u0Hent4CGF5Tkfw4vtwv2pyCXOjrvpamfNeH6jjQ", //
			"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQF-2oQulJXgfZGEIBYicK0IX1yxoHpKF0JwlFXsYt5zvmxus_vazyxuw", //
			"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQPGDsxse5pohCF2cd_9mWAF1377x6RwvIU6yyoVWxhjj1xdfoWOsm_Og", //
			"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTe9_Vzo03IUFM5v_fYfWWnzDuLuSq1g737y51shlvJ__hWj6Xgeyg6vqk", //
			"http://img1.27.cn/images/201201/11/1326273394_93568000.jpg", "http://bbs.fengbao.com/data/attachment/forum/201212/16/22205457sql8nwheiqwzn7.jpg", //
			"http://postimg1.mop.com/2011/01/30/12963700367003993.jpg", "http://www.it.com.cn/notebook/image/2009/07/05/21/090705_yp_mn_11.jpg", //
			"http://amuse.nen.com.cn/imagelist/11/51/7nja3i774c04.jpg", "http://img.ph.126.net/A1Kyew0REgVsytRza5biOA==/3266798579704329964.jpg", //
			"http://img.edentao.com/wp-content/uploads/2010/10/28/T19zpOXoXDXXb1upjX.jpg", //
			"http://img017.photo.21cn.com/photos/forum/20100914/m/C4BC4169B1540999714C457AB47DC56E.jpg", //
			"http://img017.photo.21cn.com/photos/forum/20100914/m/6FCAC700A67A6599811D6C72F782C1F2.jpg", //
			"http://images.enet.com.cn/cimg/2010/0802/c_1280735645_3.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/0df3d7ca7bcb0a46cd7bba776b63f6246b60af26.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/d6ca7bcb0a46f21ffe076f1df6246b600c33ae48.jpg", "http://pic1.nipic.com/20090311/267398_123741023_2.jpg", //
			"http://bbsimg.qianlong.com/attachments/forum/day_100926/10092617181dabd318adab5e2b.jpg", //
			"http://img.pconline.com.cn/images/upload/upc/tx/ladybbs6/1009/25/c0/5310493_1285401794899_1024x1024.jpg", //
			"http://pic1.nipic.com/20090312/267398_081715043_2.jpg", "http://bbshtml.shangdu.com/Editor/UserFiles/Image/673/61422673/1285654294501.jpg", //
			"http://pic1.nipic.com/20090312/267398_082759099_2.jpg", "http://bbsdown10.cnmo.com/attachments/201201/04/232744zy41222y1wglzyqz.jpg", //
			"http://bbsdown10.cnmo.com/attachments/201201/04/232752tttql2r9q99t9fyq.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/42a98226cffc1e177792bd7f4a90f603738de94b.jpg", //
			"http://bbsdown10.cnmo.com/attachments/201201/04/232757xo009fhmhyux9jvx.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/c2cec3fdfc0392451c76d7418794a4c27c1e25b8.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/8326cffc1e178a8247034eeef603738da977e845.jpg", //
			"http://images.enet.com.cn/cimg/2010/0802/c_1280735820_6.jpg", "http://images.enet.com.cn/cimg/2010/0802/c_1280735707_6.jpg", //
			"http://images.enet.com.cn/cimg/2010/0802/c_1280735820_5.jpg", "http://images.enet.com.cn/cimg/2010/0802/c_1280735820_3.jpg", //
			"http://data.pepo.cn/data/pepo/sxf/20080507/633457869261250000.jpg", "http://pic.100wiki.com/332mm/uploads/userup/0902/21160U52015.jpg", //
			"http://imgsrc.baidu.com/forum/pic/item/a8014c086e061d95167106767bf40ad162d9ca4c.jpg", "http://postimg1.mop.com/2011/07/21/13112306682247900.jpg", //
			"http://www.th7.cn/d/file/pm/ai/2011-06-30/8bb91fc929122781da7467e6052eb7d4.jpg", "http://www.cdtv.cn/uploadfile/2009/1012/20091012025158769.jpg", //
			"http://www.cdtv.cn/uploadfile/2009/1012/20091012025158442.jpg", "http://www.cdtv.cn/uploadfile/2009/1015/20091015114248404.jpg", //
			"http://pic1.nipic.com/2009-02-18/200921892734507_2.jpg", "http://i1091.photobucket.com/albums/i387/rinalik86d/18p2p/rina/princess01/061.jpg", //
			"http://ww1.sinaimg.cn/large/6409902bjw1dznbidpih3j.jpg", "http://ww2.sinaimg.cn/large/6409902bjw1dznbidt2d5j.jpg", //
			"http://ww3.sinaimg.cn/large/6409902bjw1dznbidpr4gj.jpg", "http://www.kaixian.tv/roll/upload/201212/25/121225140220061.jpg", //
			"http://www.kaixian.tv/roll/upload/201212/25/121225145622931.jpg", "http://t3.baidu.com/it/u=3282129,2677411319&fm=11&gp=0.jpg", //
			"http://t3.baidu.com/it/u=2269631036,3271006618&fm=11&gp=0.jpg", "http://zzxhmr.bddfzy.com/img/3950404.jpg", //
			"http://t3.baidu.com/it/u=4047781057,3743858528&fm=11&gp=0.jpg", "http://t1.baidu.com/it/u=4230562836,399823621&fm=11&gp=0.jpg", //
			"http://t2.baidu.com/it/u=468472805,3153764828&fm=11&gp=0.jpg", "http://t1.baidu.com/it/u=3077545209,2210873602&fm=11&gp=0.jpg", //
			"http://www.demptowo.info/img/xt83/4.jpg", "http://www.sinuo.info/img/xt83/2.jpg", "http://t3.baidu.com/it/u=505555592,2316590913&fm=11&gp=0.jpg", //
			"http://t2.baidu.com/it/u=3349802353,1664194021&fm=15&gp=0.jpg", "http://data.pepo.cn/data/pepo/sxf/20080507/633457869258906250.jpg", //
			"http://t1.baidu.com/it/u=2633036358,2327752027&fm=15&gp=0.jpg", "http://img11.woyopic.com/2012/0210/075/3-e9a801093733269e8e6d1af846fd1363.jpg", //
			"http://t1.baidu.com/it/u=656003012,3912870005&fm=11&gp=0.jpg", "http://t2.baidu.com/it/u=4185571722,3986303060&fm=11&gp=0.jpg", //
			"http://d4.lotpen.com/dzzz3/filelist/20121218/11/180/509723BDBE24A8249AC030CD.jpg", //
			"http://f002.bai.com/data/uploads/2012/1018/18/14ff712fbaf4f0ad53883570b34a7e57_haibao.jpeg", //
			"http://f002.bai.com/data/uploads/2012/1018/18/5da03f5f8b4c93a1d4264b3ea628c595_haibao.jpeg", //
			"http://www.kaixian.tv/roll/upload/201212/23/121225090315241.jpg", "http://t1.baidu.com/it/u=2217414181,3889338720&fm=11&gp=0.jpg", //
			"http://t3.baidu.com/it/u=1574630553,4095605949&fm=11&gp=0.jpg", "http://t1.baidu.com/it/u=3337443715,4213523697&fm=11&gp=0.jpg", //
			"http://t3.baidu.com/it/u=3829685625,1481674986&fm=11&gp=0.jpg", "http://t1.baidu.com/it/u=3815290446,307998429&fm=11&gp=0.jpg", //
			"http://t1.baidu.com/it/u=1680758880,2935488502&fm=11&gp=0.jpg", "http://www.kaixian.tv/roll/upload/201212/24/121225030787281.jpg", //
			"http://i99.ku6.com/200710/07/08/ED3b82fvz9cPG2cr/5.jpg", "http://www.aiweir.com/uploads/allimg/090614/230U64414-0.jpg", //
			"http://img1.qq.com/digi/pics/18244/18244241.jpg", "http://img.6188.net:2564/upload_6188s/flashAll/20121108/1352362574W498UL.jpg", //
			"http://www.115tp.com/uploads/allimg/1211/655.jpg", //
			"http://www.qxuc.com/photo/admin/feiyueditor/qxuc_UploadFiles/Image/2012-08/qxuc_20120809153625945.jpg", //
			"http://iphone.images.paojiao.cn/iphone/paper/20115/7/99666649/paojiao_54ae2156.jpg", //
			"http://picture.junzimen.com/UploadFiles_8785/201206/2012062913474451.jpg", "http://tuku.sdss.cn/uploadfile/201111/04/tuku8757201111040129382.jpg", //
			"http://www.guan5.com/uploads/allimg/121013/17171_121013102056_4.jpg", "http://ww2.sinaimg.cn/mw600/a3d26708jw1dsryy6p5c9j.jpg", //
			"http://img.6188.net:2564/upload_6188s/flashAll/20120601/1338530150cbLRK4.jpg", //
			"http://d.3987.com/qcmnsjbz.120830/%E6%B8%85%E7%BA%AF%E7%BE%8E%E5%A5%B3%E5%A3%81%E7%BA%B8-009.jpg", //
			"http://img.fashion.tom.com/00AWAAA4/1111/0414/4LFTXG3D.jpg", "http://wvw.mntpw.com/201012/2/1.jpg", //
			"http://www.3234.com/attaches/24/05/44636-rJOxXN.jpg", "http://d1.wpgo.cn/d12/act/20121213/16/69245712.jpg", //
			"http://img.meinv555.com/2012/1213/20121213014108906.jpg", "http://www.33.la/uploads/20121212BZXH/1225.jpg", //
			"http://pic1.win4000.com/pic/8/da/ec89238300.jpg", "http://d9.lexun.cn/9xe101/act/20111102/16/57007185.jpg", //
			"http://pic1.win4000.com/pic/8/c2/99e487644.jpg", "http://bbs.heyix.com/data/attachment/forum/201212/16/120358ae4ue4esiytsfsff.jpg", //
			"http://pic.66163.com/up_files/2012-12/775ab9f53f.jpg", "http://t3.baidu.com/it/u=2631381670,3551771159&fm=11&gp=0.jpg", //
			"http://d2.lotpen.com/dzzz3/filelist/20121216/16/ori/5018B7BBE5CD51866EB7F000.jpg", //
			"http://files.gao7.com/Files/2012/12/19/20121219150006_7768.jpg", //
			"http://d3.lotpen.com/dzzz2/filelist/20121213/19/566/50C9BC11704C9495F3A10053.jpg", "http://img1.27.cn/images/201108/10/1312962562_26965200.jpg", //
			"http://img.hqbpc.com/pic/2012/12/12025406421449.jpg", "http://bbs.51mxd.com/attachment/Mon_1211/426_1_ca2c306f4468138.jpg", //
			"http://pic5.nipic.com/20100202/795022_120222039311_2.jpg", "http://pic12.nipic.com/20110224/2531170_171635553209_2.jpg", //
			"http://pic4.nipic.com/20090807/3997_090935042_2.jpg", "http://pic11.nipic.com/20101201/3997_082059055031_2.jpg", //
			"http://pic16.nipic.com/20110910/5769559_085648551000_2.jpg", "http://pic15.nipic.com/20110617/7343041_215015613169_2.jpg", //
			"http://pic1a.nipic.com/2008-09-09/200899909752_2.jpg", "http://pic4.nipic.com/20091121/3576333_101040082179_2.jpg", //
			"http://pic14.nipic.com/20110604/7660683_140309454146_2.jpg", "http://pic4.nipic.com/20090912/115060_101647051460_2.jpg", //
	};

	public static final String ICACHE_PATH = Globals.APP_FILE_CACHE_PATH;

	public static ImageWorker newImageWorker(Activity activity, String tag)
	{
		ImageWorker imageWorker = null;
		ImageCacheParams cacheParams = new ImageCacheParams();
		cacheParams.reqWidth = activity.getResources().getDisplayMetrics().widthPixels / 5;
		cacheParams.reqHeight = (int) (cacheParams.reqWidth * 1.5);
		cacheParams.loadingResId = R.drawable.empty_photo;
		// cacheParams.clearDiskCacheOnStart = true;
		cacheParams.memCacheSize = (1024 * 1024 * Utils.getMemoryClass(activity)) / 2;
		// cacheParams.clearDiskCacheOnStart = true;
		imageWorker = ImageWorker.newInstance(activity);
		imageWorker.addParams(tag, cacheParams);
		return imageWorker;
	}

	public static void gotoImageDetail(Context context, ImageDetailActivity.ExtraParams params)
	{
		Intent it = new Intent(context, ImageDetailActivity.class);
		it.putExtra(ImageDetailActivity.EXTRA_PARAM, params);
		context.startActivity(it);
	}
}